<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>待办事宜</title>
<script>
	$(function(){
		/*列表初始化*/
		var gridParam = {
			url: '/console/project/rewrite/taskList',		
		 	columns:[[
	    	  {"field": "pRoad", "title": "工程路段", "width": 300}
	    	  ,{"field": "pNo", "title": "路段编号", "width": 250}
	    	 ,{"field": "nodeName", "title": "待办流程节点", "width": 120}
	    	 ,{"field": "createTime", "title": "创建时间", "width": 150}
			]],
			singleSelect : true,
			onSelect:function(index, row){}
		};
		var gridP =  $.extend({}, p.dataGridParam, gridParam);
		p.dataGrid = $(p.dataGrid).datagrid(gridP);

		/*事件响应*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var id = $(this).attr("motion_code");
			var flag = $(this).hasClass("l-btn-disabled");
			if(flag) return ;
			switch (id) {
				case "09":
					var row = p.getSelection('请先选定一条记录再处理!');
					if(row){
						var buttons = [{
							text : "驳回", iconCls : "icon-back", handler : function() {
								$.getJSON("/console/project/rewrite/back/"+row.pId, {} ,function(res){
									if(res.flag){
										p.tip({msg: '驳回成功！'});  
										p.gridQuery();
									}else{
										p.tip({msg:  res.msg});  
									}
					        	 });
								p.gridQuery();
								p.dialog.dialog('close');
							}
						},p.buttons.submit,p.buttons.close];
						var url = '/console/project/rewrite/actionPage/'+ row.pId + '?pid='+  row.pId +'&pNo='+ row.pNo;
						p.gridModify({href:url, title : "【"+row.pRoad+  "】立项流程处理", width : 850, height : 430 ,autoMax:true,
							buttons: buttons
						});
					}
					break;
				case "05":
					p.gridQuery();
					break;
				case "10":
					var row = p.getSelection('请先选定一条记录再查看详情!');
					if(row){
						p.gridOpt({href:'/console/project/config?id='+ row.id + '&pNo='+ row.pNo, title : "更多项目详情", width : 850, height : 430 ,autoMax:true});
					}
					break;
				case "20":
					var row = p.getSelection('请先选定一条记录再流程状态查看!');
					if(row){
						p.gridOpt({href:'/console/project/rewrite/flow?id='+ row.pId + '&pNo='+ row.pNo, title : row.pNo+ "项目流程状态查看", width : 850, height : 430 ,autoMax:true});
					}
					break;
				default:
					break;
			}
		});
	});
</script>
</head>
<body  class="easyui-layout">
		<!-- 但行高度33px，多行时 33乘以行数  -->
		<div id="querybar" data-options="region:'north',split:false,border:false" style="height:33px;">
			<div class="easyui-panel" data-options="fit:true,border:false">
				<!-- 查询条件表单，根据配置进行替换  -->
				<form id="queryForm" >
				 <input type="hidden" name="className" value="com.fs.base.pojo.Role" />
				 <div style="margin-top:5px;margin-left:10px;float:left;">
				  	<input class="easyui-textbox" name="pNo" style="width:240px;" data-options="label:'路段编号:',required:false" />
				 </div>
				</form>
			</div>
		</div>  
	
		<!-- 工具栏按钮 -->
		<div id="toolbar" class="easyui-panel" style="padding:3px;"></div>
		
		<!-- 表格 -->
		<div region="center" border="false">
			<table id="dataGrid"></table>
		</div>
</body>
</html>